const path = require('path')
var str = 'D:\总共文件\JS\线下就业班\nodejs\node资料/abj.js'
console.log(path.basename(str))//abj.js
console.log(path.basename(str, 'js'))//abj,
console.log(path.dirname(str))//返回的是目录
console.log(path.extname(str))//.js